package com.bw.module_home.model.repository

import com.bw.module_home.model.api.HomeApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

class HomeRepository @Inject constructor(private val homeApi: HomeApi) {
    fun getSimpleType() = flow {
        emit(homeApi.getSimpleType())
    }.flowOn(Dispatchers.IO)

    fun getSimpleVideoByChannelId(channelId: String,page: Int,pageSize: Int) = flow {
        emit(homeApi.getSimpleVideoByChannelId(channelId,page,pageSize))
    }.flowOn(Dispatchers.IO)
    //首页视频列表
    fun getRecommendSimpleVideo(page:Int,pagesize:Int) = flow {
        emit(homeApi.getRecommendSimpleVideo(page,pagesize))

    }.flowOn(Dispatchers.IO)
}